<template>
	<view>
		<u-tabbar :value="name" activeColor="#23aa59">
			<u-tabbar-item name="yesterday" text="昨日" @click="goUrl('yesterday')">
				<image class="active" slot="active-icon" src="/static/driver/before-active.png"></image>
				<image class="inactive" slot="inactive-icon" src="/static/driver/before.png"></image>
			</u-tabbar-item>	
			<u-tabbar-item name="today" text="今日" @click="goUrl('today')">
				<image class="active" slot="active-icon" src="/static/driver/today-active.png"></image>
				<image class="inactive" slot="inactive-icon" src="/static/driver/today.png"></image>
			</u-tabbar-item>
			<u-tabbar-item name="tomorrow" text="明日" @click="goUrl('tomorrow')">
				<image class="active" slot="active-icon" src="/static/driver/tomorow-active.png"></image>
				<image class="inactive" slot="inactive-icon" src="/static/driver/tomorow.png"></image>
			</u-tabbar-item>
			<u-tabbar-item name="index" text="我的" @click="goUrl('index')">
				<image class="active" slot="active-icon" src="/static/driver/suser-active.png"></image>
				<image class="inactive" slot="inactive-icon" src="/static/driver/suser.png"></image>
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		props: {
			name:{
				type:String,
				default:''
			}
		},
		data() {
			return {
						
			}
		},
		created(e) {
			
		},
		methods: {
			goUrl:function(name){
				if(this.name==name){
					return;
				}
				uni.redirectTo({
					url:'/pages/driver/'+name,
					fail(e) {
						console.log(e);
					}
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.active,.inactive{
		width: 50rpx;
		height: 50rpx;
	}

</style>
